<html>
<head>
<title>File Source for functions.db.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">smt2</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
        
                                    
                                                                      		  [ <a href="../classtrees_smt2.html" class="menu">class tree: smt2</a> ]
		  [ <a href="../elementindex_smt2.html" class="menu">index: smt2</a> ]
		  	    [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
      <b>Packages:</b><br />
              <a href="../li_smt2.html">smt2</a><br />
              <a href="../li_PegasusPHP.html">PegasusPHP</a><br />
              <a href="../li_PHPMailer.html">PHPMailer</a><br />
            <br /><br />
                  
      
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file functions.db.php</h1>
<p>Documentation is available at <a href="../smt2/_functions.db.php.html">functions.db.php</a></p>
<div class="src-code">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;class&nbsp;is&nbsp;a&nbsp;wrapper&nbsp;layer&nbsp;for&nbsp;all&nbsp;required&nbsp;MySQL&nbsp;queries.</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;It&nbsp;is&nbsp;highly&nbsp;recommended&nbsp;to&nbsp;use&nbsp;them&nbsp;instead&nbsp;of&nbsp;the&nbsp;current&nbsp;PHP&nbsp;functions,</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;because&nbsp;in&nbsp;that&nbsp;way&nbsp;it&nbsp;is&nbsp;possible&nbsp;to&nbsp;abstract&nbsp;this&nbsp;layer</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;and&nbsp;use&nbsp;different&nbsp;database&nbsp;engines.</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-tag">@date</span><span class="src-doc">&nbsp;27/March/2009</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a9"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">/**&nbsp;</span><span class="src-doc-coretag">@global&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">&nbsp;&nbsp;look&nbsp;for&nbsp;(smt)2&nbsp;tables&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-var">$_lookupTables&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_RECORDS">TBL_RECORDS</a></span><span class="src-sym">,</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_CACHE">TBL_CACHE</a></span><span class="src-sym">,</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_BROWSERS">TBL_BROWSERS</a></span><span class="src-sym">,</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_OS">TBL_OS</a></span><span class="src-sym">,</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_USERS">TBL_USERS</a></span><span class="src-sym">,</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_ROLES">TBL_ROLES</a></span><span class="src-sym">,</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_EXTS">TBL_EXTS</a></span><span class="src-sym">,</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_CMS">TBL_CMS</a></span><span class="src-sym">,</span><span class="src-id"><a href="../smt2/_define.php.html#defineTBL_JSOPT">TBL_JSOPT</a></span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a12"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;Opens&nbsp;or&nbsp;reuses&nbsp;a&nbsp;connection&nbsp;against&nbsp;the&nbsp;database&nbsp;server.</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">resource&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;connection&nbsp;link&nbsp;identifier</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_connect">db_connect</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a19"></a>&nbsp;&nbsp;<span class="src-var">$idcnx&nbsp;</span>=&nbsp;<a href="http://www.php.net/mysql_connect">mysql_connect</a><span class="src-sym">(</span><span class="src-id">DB_HOST</span><span class="src-sym">,&nbsp;</span><span class="src-id">DB_USER</span><span class="src-sym">,&nbsp;</span><span class="src-id">DB_PASSWORD</span><span class="src-sym">)&nbsp;</span><span class="src-key">or&nbsp;</span><a href="http://www.php.net/trigger_error">trigger_error</a><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/mysql_error">mysql_error</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a20"></a>&nbsp;&nbsp;<a href="http://www.php.net/mysql_select_db">mysql_select_db</a><span class="src-sym">(</span><span class="src-id">DB_NAME</span><span class="src-sym">,&nbsp;</span><span class="src-var">$idcnx</span><span class="src-sym">)&nbsp;</span><span class="src-key">or&nbsp;</span><a href="http://www.php.net/trigger_error">trigger_error</a><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/mysql_error">mysql_error</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a22"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$idcnx</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a24"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-doc">&nbsp;*&nbsp;Performs&nbsp;a&nbsp;generic&nbsp;query&nbsp;to&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;</span><span class="src-doc-var">$sql&nbsp;</span><span class="src-doc">&nbsp;SQL&nbsp;query</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">resource&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resource&nbsp;query&nbsp;identifier</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_query">db_query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a32"></a>&nbsp;&nbsp;<span class="src-var">$cnx&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_connect">db_connect</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<a href="http://www.php.net/mysql_query">mysql_query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">,&nbsp;</span><span class="src-var">$cnx</span><span class="src-sym">)&nbsp;</span><span class="src-key">or&nbsp;</span><a href="http://www.php.net/trigger_error">trigger_error</a><span class="src-sym">(&nbsp;</span><a href="http://www.php.net/mysql_error">mysql_error</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;*&nbsp;Gets&nbsp;column(s)&nbsp;value(s)&nbsp;of&nbsp;a&nbsp;single&nbsp;row&nbsp;from&nbsp;a&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;function&nbsp;can&nbsp;be&nbsp;used&nbsp;also&nbsp;to&nbsp;check&nbsp;if&nbsp;a&nbsp;row&nbsp;field&nbsp;exists.</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;column(s)&nbsp;name(s)</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;</span><span class="src-doc-var">$table&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;</span><span class="src-doc-var">$condition&nbsp;</span><span class="src-doc">&nbsp;WHERE&nbsp;condition.&nbsp;To&nbsp;allow&nbsp;row&nbsp;ordering&nbsp;without&nbsp;WHERE&nbsp;clause,&nbsp;you&nbsp;can&nbsp;use&nbsp;&quot;1&nbsp;ORDER&nbsp;BY&nbsp;...&quot;</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Associative&nbsp;array&nbsp;with&nbsp;column(s)&nbsp;name(s)&nbsp;as&nbsp;keys&nbsp;on&nbsp;success&nbsp;or&nbsp;FALSE&nbsp;on&nbsp;failure</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a46"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_select">db_select</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$condition</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a48"></a>&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">SELECT&nbsp;<span class="src-var">$column</span>&nbsp;FROM&nbsp;<span class="src-var">$table</span>&nbsp;WHERE&nbsp;<span class="src-var">$condition</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_query">db_query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a50"></a>&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/mysql_num_rows">mysql_num_rows</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">)&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a51"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/mysql_fetch_assoc">mysql_fetch_assoc</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a52"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a57"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a58"></a><span class="src-doc">&nbsp;*&nbsp;Selects&nbsp;ALL&nbsp;rows&nbsp;and&nbsp;columns&nbsp;from&nbsp;table&nbsp;that&nbsp;match&nbsp;the&nbsp;given&nbsp;condition.</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$table&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;column&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a61"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$condition&nbsp;</span><span class="src-doc">&nbsp;WHERE&nbsp;condition.&nbsp;To&nbsp;allow&nbsp;row&nbsp;ordering&nbsp;without&nbsp;WHERE&nbsp;clause,&nbsp;you&nbsp;can&nbsp;use&nbsp;&quot;1&nbsp;ORDER&nbsp;BY&nbsp;...&quot;</span></div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;with&nbsp;all&nbsp;queried&nbsp;rows.</span></div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_select_all">db_select_all</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$condition</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">SELECT&nbsp;<span class="src-var">$column</span>&nbsp;FROM&nbsp;<span class="src-var">$table</span>&nbsp;WHERE&nbsp;<span class="src-var">$condition</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a68"></a>&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_query">db_query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;<span class="src-comm">//&nbsp;get&nbsp;ALL&nbsp;rows</span></div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;<span class="src-var">$opt&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-var">$row&nbsp;</span>=&nbsp;<a href="http://www.php.net/mysql_fetch_assoc">mysql_fetch_assoc</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a72"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$opt</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$row</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a73"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a74"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a75"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$opt</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a76"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a78"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-doc">&nbsp;*&nbsp;Deletes&nbsp;a&nbsp;row&nbsp;from&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a80"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$table&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;able&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a81"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$condition&nbsp;</span><span class="src-doc">&nbsp;WHERE&nbsp;clause&nbsp;(i.e:&nbsp;id='#'&nbsp;LIMIT&nbsp;1)</span></div></li>
<li><div class="src-line"><a name="a82"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TRUE&nbsp;on&nbsp;success,&nbsp;or&nbsp;FALSE&nbsp;on&nbsp;failure</span></div></li>
<li><div class="src-line"><a name="a83"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a84"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_delete">db_delete</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">,&nbsp;</span><span class="src-var">$condition</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a85"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">DELETE&nbsp;FROM&nbsp;<span class="src-var">$table</span>&nbsp;WHERE&nbsp;<span class="src-var">$condition</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_query">db_query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a90"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a92"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a93"></a><span class="src-doc">&nbsp;*&nbsp;Inserts&nbsp;a&nbsp;new&nbsp;row&nbsp;on&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a94"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;</span><span class="src-doc-var">$table&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a95"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;</span><span class="src-doc-var">$fields&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;column(s)&nbsp;name(s)</span></div></li>
<li><div class="src-line"><a name="a96"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;</span><span class="src-doc-var">$values&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;column(s)&nbsp;value(s)</span></div></li>
<li><div class="src-line"><a name="a97"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last&nbsp;instered&nbsp;row&nbsp;id,&nbsp;or&nbsp;FALSE&nbsp;on&nbsp;failure</span></div></li>
<li><div class="src-line"><a name="a98"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a99"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_insert">db_insert</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">,&nbsp;</span><span class="src-var">$fields</span><span class="src-sym">,&nbsp;</span><span class="src-var">$values</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a100"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">INSERT&nbsp;INTO&nbsp;<span class="src-var">$table</span>&nbsp;(<span class="src-var">$fields</span>)&nbsp;VALUES&nbsp;(<span class="src-var">$values</span>)</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_query">db_query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/mysql_insert_id">mysql_insert_id</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a105"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a107"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a108"></a><span class="src-doc">&nbsp;*&nbsp;Updates&nbsp;a&nbsp;row&nbsp;on&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a109"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$table&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a110"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$tuples&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;column(s)&nbsp;name(s)&nbsp;and&nbsp;value(s)&nbsp;in&nbsp;the&nbsp;form&nbsp;column=value&nbsp;(i.e:&nbsp;col='val',foo='val',...)</span></div></li>
<li><div class="src-line"><a name="a111"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$condition&nbsp;</span><span class="src-doc">&nbsp;WHERE&nbsp;clause&nbsp;(i.e:&nbsp;id='#'&nbsp;LIMIT&nbsp;1)</span></div></li>
<li><div class="src-line"><a name="a112"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TRUE&nbsp;on&nbsp;success,&nbsp;or&nbsp;FALSE&nbsp;on&nbsp;failure</span></div></li>
<li><div class="src-line"><a name="a113"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a114"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_update">db_update</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">,&nbsp;</span><span class="src-var">$tuples</span><span class="src-sym">,&nbsp;</span><span class="src-var">$condition</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a115"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">UPDATE&nbsp;<span class="src-var">$table</span>&nbsp;SET&nbsp;<span class="src-var">$tuples</span>&nbsp;WHERE&nbsp;<span class="src-var">$condition</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_query">db_query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$res</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a120"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a121"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a122"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a123"></a><span class="src-doc">&nbsp;*&nbsp;Checks&nbsp;that&nbsp;both&nbsp;database&nbsp;connection&nbsp;and&nbsp;tables&nbsp;are&nbsp;OK.</span></div></li>
<li><div class="src-line"><a name="a124"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">&nbsp;&nbsp;TRUE&nbsp;on&nbsp;sucess,&nbsp;or&nbsp;FALSE&nbsp;on&nbsp;failure</span></div></li>
<li><div class="src-line"><a name="a125"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a126"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_check">db_check</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a127"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a128"></a>&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$_lookupTables</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a129"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$_lookupTables&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$table</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_query">db_query</a><span class="src-sym">(</span><span class="src-str">&quot;SHOW&nbsp;TABLES&nbsp;LIKE&nbsp;'&quot;</span>.<span class="src-id">TBL_PREFIX</span>.<span class="src-var">$table</span>.<span class="src-str">&quot;'&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$cnx</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/mysql_num_rows">mysql_num_rows</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a136"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a137"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a139"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a140"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a141"></a><span class="src-doc">&nbsp;*&nbsp;Shortcut&nbsp;for&nbsp;getting&nbsp;the&nbsp;total&nbsp;number&nbsp;of&nbsp;(smt)&nbsp;records&nbsp;in&nbsp;database,&nbsp;or&nbsp;alternatively&nbsp;the&nbsp;column&nbsp;names.</span></div></li>
<li><div class="src-line"><a name="a142"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$getColNames&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;return&nbsp;column&nbsp;names&nbsp;instead&nbsp;of&nbsp;number&nbsp;of&nbsp;records</span></div></li>
<li><div class="src-line"><a name="a143"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;total&nbsp;DB&nbsp;entries&nbsp;(int)&nbsp;or&nbsp;column&nbsp;names&nbsp;(array)</span></div></li>
<li><div class="src-line"><a name="a144"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a145"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_records">db_records</a><span class="src-sym">(</span><span class="src-var">$getColNames&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a146"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;&nbsp;<span class="src-var">$n&nbsp;</span>=&nbsp;<span class="src-sym">(</span><span class="src-var">$getColNames</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-str">&quot;*&quot;&nbsp;</span>:&nbsp;<span class="src-str">&quot;id&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;<span class="src-var">$res&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_query">db_query</a><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">SELECT&nbsp;<span class="src-var">$n</span>&nbsp;FROM&nbsp;</span><span class="src-str">&quot;</span>.<span class="src-id">TBL_PREFIX</span>.<span class="src-id"><a href="../smt2/_define.php.html#defineTBL_RECORDS">TBL_RECORDS</a></span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a149"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$getColNames</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>&lt;&nbsp;<a href="http://www.php.net/mysql_num_fields">mysql_num_fields</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a153"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$meta&nbsp;</span>=&nbsp;<a href="http://www.php.net/mysql_fetch_field">mysql_fetch_field</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">,&nbsp;</span><span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a154"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$headers</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$meta</span><span class="src-sym">-&gt;</span><span class="src-id">name</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a155"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$i</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a156"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a157"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$headers</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a158"></a>&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/mysql_num_rows">mysql_num_rows</a><span class="src-sym">(</span><span class="src-var">$res</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a160"></a>&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span></div></li>
<li><div class="src-line"><a name="a161"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a162"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a163"></a><span class="src-doc">/**&nbsp;</span></div></li>
<li><div class="src-line"><a name="a164"></a><span class="src-doc">&nbsp;*&nbsp;Selects&nbsp;one&nbsp;(and&nbsp;only&nbsp;one)&nbsp;row&nbsp;from&nbsp;an&nbsp;&quot;options&quot;&nbsp;table&nbsp;(CMS&nbsp;or&nbsp;JSOPT).</span></div></li>
<li><div class="src-line"><a name="a165"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;function&nbsp;is&nbsp;a&nbsp;wrapper&nbsp;for&nbsp;'db_select()'.</span></div></li>
<li><div class="src-line"><a name="a166"></a><span class="src-doc">&nbsp;*&nbsp;Instead&nbsp;of&nbsp;having&nbsp;to&nbsp;deal&nbsp;with&nbsp;an&nbsp;associative&nbsp;array&nbsp;of&nbsp;one&nbsp;key&nbsp;alone,</span></div></li>
<li><div class="src-line"><a name="a167"></a><span class="src-doc">&nbsp;*&nbsp;this&nbsp;function&nbsp;speeds&nbsp;the&nbsp;process&nbsp;and&nbsp;returns&nbsp;the&nbsp;array&nbsp;member&nbsp;value.</span></div></li>
<li><div class="src-line"><a name="a168"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$table&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a169"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$optionName&nbsp;</span><span class="src-doc">&nbsp;&nbsp;option&nbsp;name&nbsp;stored&nbsp;on&nbsp;&quot;name&quot;&nbsp;column</span></div></li>
<li><div class="src-line"><a name="a170"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Option&nbsp;value</span></div></li>
<li><div class="src-line"><a name="a171"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a172"></a><span class="src-key">function&nbsp;</span><a href="../smt2/_functions.db.php.html#functiondb_option">db_option</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">,&nbsp;</span><span class="src-var">$optionName</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a173"></a><span class="src-sym">{&nbsp;</span></div></li>
<li><div class="src-line"><a name="a174"></a>&nbsp;&nbsp;<span class="src-var">$row&nbsp;</span>=&nbsp;<a href="../smt2/_functions.db.php.html#functiondb_select">db_select</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;value&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;name='&quot;</span>.<span class="src-var">$optionName</span>.<span class="src-str">&quot;'&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a175"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a176"></a>&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-str">'value'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a177"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a178"></a><span class="src-php">?&gt;</span></div></li>
</ol>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Thu, 30 Sep 2010 18:26:49 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.1</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>